/**
 * Copyright 2008-2009 HAN.BIFANG
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package han.bifang.gwt.client.common;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.TabBar;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * 
 * @Author Kent
 */
public class SingleTab extends Composite {
	
	private Grid layout = null;
	private VerticalPanel panel = null;
	public SingleTab(String tabName){
		
		layout = new Grid(2,1);
		layout.setBorderWidth(0);
		layout.setCellPadding(0);
		layout.setCellSpacing(0);
		//layout.setStyleName("bifang-Grid");
		
		
		TabBar bar = new TabBar();
		bar.addTab(tabName);
		bar.setStyleName("bifang-TabBar");
		bar.selectTab(0);
		
		layout.setWidget(0,0, bar);
//		layout.setHTML(1,0, "&nbsp;");
//		
		
		
		panel = new VerticalPanel();
		panel.setWidth("100%");
		panel.setSpacing(0);
		
		//panel.setStyleName("sc-ContentWidget");
		layout.setWidget(1, 0, panel);
		initWidget(layout);
	}
	
	public void addContent(Widget w){
		//w.setWidth("100%");
		panel.add(w);
	}

}
